<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Fetches the current row from a result set as an array</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.sqlite-create-function.html">sqlite_create_function</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.sqlite-error-string.html">sqlite_error_string</a></div>
 <div class="up"><a href="ref.sqlite.html">SQLite 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.sqlite-current" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">sqlite_current</h1>
  <h1 class="refname">SQLiteResult::current</h1>
  <h1 class="refname">SQLiteUnbuffered::current</h1>
  <p class="verinfo">(PHP 5 &lt; 5.4.0, PECL sqlite &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">sqlite_current</span> -- <span class="refname">SQLiteResult::current</span> -- <span class="refname">SQLiteUnbuffered::current</span> &mdash; <span class="dc-title">Fetches the current row from a result set as an array</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.sqlite-current-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>sqlite_current</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
   [, <span class="methodparam"><span class="type">int</span> <code class="parameter">$result_type</code><span class="initializer"> = SQLITE_BOTH</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$decode_binary</code><span class="initializer"> = true</span></span>
  ]] )</div>

  <p class="para rdfs-comment">面向对象风格 (method):</p>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>SQLiteResult::current</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$result_type</code><span class="initializer"> = SQLITE_BOTH</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$decode_binary</code><span class="initializer"> = true</span></span>
  ]] )</div>

  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><strong>SQLiteUnbuffered::current</strong></span>
    ([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$result_type</code><span class="initializer"> = SQLITE_BOTH</span></span>
   [, <span class="methodparam"><span class="type">bool</span> <code class="parameter">$decode_binary</code><span class="initializer"> = true</span></span>
  ]] )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>sqlite_current()</strong></span> is identical to
   <span class="function"><a href="function.sqlite-fetch-array.html" class="function">sqlite_fetch_array()</a></span> except that it does not advance
   to the next row prior to returning the data; it returns the data from the
   current position only.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.sqlite-current-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">result</code></em></dt>

     <dd>

      <p class="para">
       The SQLite result resource.  This parameter is not required when using
       the object-oriented method.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">result_type</code></em></dt>

     <dd>

      <p class="para">可选的 <em><code class="parameter">result_type</code></em>
参数接受常量，且决定返回的数组如何被索引。使用
<strong><code>SQLITE_ASSOC</code></strong> 会仅返回关联索引（已命名字段），而
<strong><code>SQLITE_NUM</code></strong> 会仅返回数值索引。<strong><code>SQLITE_BOTH</code></strong>
会同时返回关联和数值索引。<strong><code>SQLITE_BOTH</code></strong> 是此函数的默认值。</p>
     </dd>

    
    
     <dt>
<em><code class="parameter">decode_binary</code></em></dt>

     <dd>

      <p class="para">当
<em><code class="parameter">decode_binary</code></em> 参数设置为 <strong><code>TRUE</code></strong>（默认值）时，PHP 会解码那些由
<span class="function"><a href="function.sqlite-escape-string.html" class="function">sqlite_escape_string()</a></span>
编码后的二进制数据。通常应保留此值为其默认值，除非要与其他使用 SQLlite 的应用程序建立的数据交互。</p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.sqlite-current-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns an array of the current row from a result set; <strong><code>FALSE</code></strong> if the
   current position is beyond the final row.
  </p>
  <p class="para">由
<strong><code>SQLITE_ASSOC</code></strong> 与 <strong><code>SQLITE_BOTH</code></strong>
返回的列名会依照 <a href="sqlite.configuration.html#ini.sqlite.assoc-case" class="link">sqlite.assoc_case</a>
配置选项的值决定大小写。</p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.sqlite-current-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.sqlite-seek.html" class="function" rel="rdfs-seeAlso">sqlite_seek()</a> - Seek to a particular row number of a buffered result set</span></li>
    <li class="member"><span class="function"><a href="function.sqlite-next.html" class="function" rel="rdfs-seeAlso">sqlite_next()</a> - Seek to the next row number</span></li>
    <li class="member"><span class="function"><a href="function.sqlite-fetch-array.html" class="function" rel="rdfs-seeAlso">sqlite_fetch_array()</a> - Fetches the next row from a result set as an array</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.sqlite-create-function.html">sqlite_create_function</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.sqlite-error-string.html">sqlite_error_string</a></div>
 <div class="up"><a href="ref.sqlite.html">SQLite 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
